#include <bits/stdc++.h>
using namespace std;
#define int long long

int k, n;

int T[11], D[11], L[11];
int flag;
bool chick[11];

void dfs(int x, int tim)//第机架飞机降落，降落时的时间
{
	if (x == n)
	{
		flag = 1;
		return;
	}
	
	for (int i = 0; i < n; i++)
	{
		if (!chick[i] && tim <= T[i] + D[i])
		{
			chick[i] = true;
			dfs(x + 1, max(tim, T[i]) + L[i]);
			chick[i] = false;	
		}
	}
}

void slove()
{
	flag = 0;
	cin >> n;
	for (int i = 0; i < n; i++) chick[i] = false;
	for (int i = 0; i < n; i++)
		cin >> T[i] >> D[i] >> L[i];
	
	dfs(0, 0);
	if (flag) cout << "YES" << endl;
	else cout << "NO" << endl;
}
signed main()
{
	ios::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	
	cin >> k;
	while (k--)
		slove();	
	return 0;
}